﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BBPA.Admin.SYS.Orders.History
{
    public partial class List : ListPage
    {
        BLL.V_Orders bllList = new BLL.V_Orders();
        BLL.Orders bll = new BLL.Orders();
        //
        protected string IsDelivery = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            Master.show_info = false;
            Master.show_edit = false;
            IsDelivery = DataTypePlus.requestString(Request.QueryString["IsDelivery"]);
            switch (Security.GetCurrentUserType())
            {
                case EnumHelper.UserType.Buyer:
                    IsDelivery = "0";
                    break;
                case EnumHelper.UserType.Receiver:
                    IsDelivery = "1";
                    break;
                default:
                    IsDelivery = "";
                    break;
            }
            string sql_IsDelivery = "select OrdersID from V_Orders_Goods where IsDelivery=" + IsDelivery;
            Master.BasicSQL = "State=" + (int)EnumHelper.OrdersState.HasSend;
            if (IsDelivery != "") Master.BasicSQL += " and id in (" + sql_IsDelivery + ")";
        }
        public override void buildSQL_Page_List_search()
        {
        }
        public override DataSet get_Page_DataSet(string sql_, string orderby_, int pageFrom_, int pageTo_) { return bllList.GetListByPage(sql_, orderby_, pageFrom_, pageTo_); }
    }
}